package com.example.controller;

import com.example.result.Result;
import com.example.service.DepartmentService;
import com.example.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping(value = "/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院编号查询所有科室
    @ApiOperation("根据医院编号查询所有科室")
    @GetMapping("getDeptList/{hosCode}")
    public Result getDeptList(@PathVariable String hosCode){
        List<DepartmentVo> list = departmentService.findDeptTree(hosCode);
        return Result.ok(list);
    }


}
